import java.io.*;
import javax.swing.*;
import javax.swing.filechooser.FileFilter;
public class FileDiaglogDemo {
    public static void main(String[] args) {
        // TODO code application logic here
      JFileChooser jfc = new JFileChooser("c:\\");
      jfc.setFileFilter(new FileFilter() {
              public boolean accept(File f)
              {
                   return f.getName().endsWith(".mp3");
              }
              public String getDescription()
                  { return "mp3文件";}
         });
      jfc.setMultiSelectionEnabled(true);
      int ret = jfc.showOpenDialog(null);
      File[] files=jfc.getSelectedFiles();
      
      for(File file : files)
          JOptionPane.showMessageDialog(null,file.getPath());

    }

}
